<nav class="pager">
    <li class="previous"><span class="prev">PREVIOUS</span><?php $prev_post = get_previous_post();if (!empty( $prev_post )): ?><a
        class="prevspan" title="<?php echo $prev_post->post_title; ?>"
        href="<?php echo get_permalink( $prev_post->ID ); ?>"><?php echo $prev_post->post_title; ?></a><?php else: ?><a
        class="prevspan">没有上一篇了</a><?php endif; ?></li>
    <li class="nextpost"><span class="next">NEXT</span><?php $next_post = get_next_post();if (!empty( $next_post )): ?><a
        class="nextspan" title="<?php echo $next_post->post_title; ?>"
        href="<?php echo get_permalink( $next_post->ID ); ?>"><?php echo $next_post->post_title; ?></a><?php else: ?><a
        class="nextspan">没有下一篇了</a><?php endif; ?></li>
</nav>